<div class="container-fluid">
    <div class="block-header">
        <h2>用户 > 联盟系统 > 支付请求</h2>
    </div>
    <div class="row">
    	<div class="col-lg-3 col-md-3">
            <div class="info-box bg-blue hover-expand-effect">
                <div class="icon">
                    <i class="material-icons">storage</i>
                </div>
                <div class="content">
                    <div class="text">总请求数</div>
                    <div class="number count-to" data-from="0" data-to="<?php echo Wo_CountPaymentHistory(0); ?>" data-speed="1000" data-fresh-interval="20"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-3 ">
            <div class="info-box bg-blue hover-expand-effect">
                <div class="icon">
                    <i class="material-icons">check</i>
                </div>
                <div class="content">
                    <div class="text">支付请求</div>
                    <div class="number count-to" data-from="0" data-to="<?php echo Wo_CountPaymentHistory(1); ?>" data-speed="1000" data-fresh-interval="20"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-3 ">
            <div class="info-box bg-blue hover-expand-effect">
                <div class="icon">
                    <i class="material-icons">av_timer</i>
                </div>
                <div class="content">
                    <div class="text">拒绝请求</div>
                    <div class="number count-to" data-from="0" data-to="<?php echo Wo_CountPaymentHistory(2); ?>" data-speed="1000" data-fresh-interval="20"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-3 ">
            <div class="info-box bg-blue hover-expand-effect">
                <div class="icon">
                    <i class="material-icons">mail_outline</i>
                </div>
                <div class="content">
                    <div class="text">待定请求</div>
                    <div class="number count-to" data-from="0" data-to="<?php echo Wo_CountPaymentHistory(0); ?>" data-speed="1000" data-fresh-interval="20"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-12 col-md-12">
            <div class="card">
                <div class="header">
                    <h2>管理支付请求</h2>
                    <h5>付款是从您的PayPal帐户支付，在付款后，将请求标记为已付款.</h5>
                </div>
                <div class="body">
                   <div class="table-responsive1">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                      <th>ID</th>
					                  <th>用户名</th>
					                  <th>PayPal电子邮件</th>
					                  <th>数量</th>
					                  <th>介绍人</th>
					                  <th>状态</th>
					                  <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php 
				                foreach (Wo_GetAllPaymentsHistory('all') as $wo['userlist']) {
				                    echo Wo_LoadAdminPage('payment-reqeuests/list');
				                }
				                ?>
                            </tbody>
                        </table>
                    </div>
                    <input type="hidden" id="hash_id" name="hash_id" value="<?php echo Wo_CreateSession();?>">
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    </div>
    <!-- #END# Vertical Layout -->
<script>
$(function () {
  $('table').DataTable();
});
function Wo_DeclinePayment(id) {
  if (confirm("您确定要拒绝此请求吗?") == false) {
    return false;
  }
  hash_id = $('#hash_id').val();
  $('#UserID_' + id).fadeOut(300, function() {
    $(this).remove();
  });
  $.get(Wo_Ajax_Requests_File(),{f:'admin_setting', s:'decline_payment', id: id, hash_id: hash_id});
}
function Wo_MarkPaid(id) {
  if (confirm("您确定要将请求标记为已付款吗？") == false) {
    return false;
  }
  $('#UserID_' + id).fadeOut(300, function() {
    $(this).remove();
  });
  hash_id = $('#hash_id').val();
  $.get(Wo_Ajax_Requests_File(),{f:'admin_setting', s:'mark_as_paid', id: id, hash_id: hash_id});
}
</script>